home *** CD-ROM | disk | FTP | other *** search
- Path: news.production.compuserve.com!news
- From: Merlin Chowkwanyun <71702.1123@CompuServe.COM>
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: RANDOM NUMBER GENERATOR
- Date: 7 Jan 1996 04:33:51 GMT
- Organization: CompuServe, Inc. (1-800-689-0736)
- Message-ID: <4cniff$11o$1@mhade.production.compuserve.com>
-
- Just thought you might like to know that I found this random number generator
- lying around in an old C++ magazine
-
- /declares a global random number generating function
-
- int random(int MaxVal)
- {
- return rand() % MaxVal;
- }
-
- Be sure to include the header file stdlib.h
-
- Merlin
-